# -*- coding:utf-8 -*-
from fastapi import Request
from core.curd import IBaseService
from app.dao.system import SysUserDao 
from typing import List

class SysUserService(IBaseService):

    async def create_user(self, post: dict ):
        return await self.dao.create_user(post)

    async def delete_user(self, ids: List[int]):
        return await self.dao.delete_user(ids)

    async def update_user(self, post: dict):
        return await self.dao.update_user(post)

    async def get_user_role(self, id:int):
        return await self.dao.get_user_role(id)
    async def get_user_post(self, id:int):
        return await self.dao.get_user_post(id)

    async def get_user_dept_info(self, id:int):
        return await self.dao.get_user_dept_info(id)

    async def get_user_post_info(self, id:int):
        return await self.dao.get_user_post_info(id)

    async def get_user_role_info(self, id:int):
        return await self.dao.get_user_role_info(id)

    @classmethod
    async def instance(cls, req: Request):
        inst = cls()
        inst.dao = await SysUserDao.instance(req)
        return inst
